﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<CategoryViewData>" %>
<%@ Import Namespace="AukcjeInternetowe.Models" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    CategoryItemList
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

<style type="text/css">
    .itemlist .headerName
    {
        font-style : italic;
    }

    .itemlist .titleColumn
    {
        width : 70%;
    }

    .itemlist .price
    {
        width : 15%;
    }

    .itemlist .date
    {
        width : 15%;
    }
</style>
<h2><%= (Model.Category == null ? "Lista wszystkich produktów:" : "Lista produktów dla kategorii: " + Model.Category.CategoryName) %></h2>

<div class="itemlist">
    <table>
        <tr>
            <th class="image">
                <p class="headerName"></p>
            </th>
            <th class="titleColumn">
                <p class="headerName">Nazwa</p>
            </th>
            <th class="price">
                <p class="headerName">Cena</p>
            </th>
            <th class="date">
                <p class="headerName">Do zakończenia</p>
            </th>
            <th></th>
        </tr>

    <% foreach (var item in Model.CategoryItems) { %>
        <tr>
            <% Html.RenderPartial("CategoryItem", item); %>
        </tr>
    <% } %>
    </table>
</div>

</asp:Content>
